@echo on
echo --------------------------------------------------------------preBuildEvent.cmd begin
set xSolutionDir=%~1
set xWixProjectDir=%~2
set xMsiProductName=%~3
set xInputToWix=%~4
set xConfigurationName=%~5
set xPlatformName=%~6
set xProductVersion=%~7

echo xSolutionDir	= %xSolutionDir%
echo xWixProjectDir	= %xWixProjectDir%
echo xMsiProductName= %xMsiProductName%
echo xInputToWix	= %xInputToWix%
echo xConfigurationName	= %xConfigurationName%
echo xPlatformName	= %xPlatformName%
echo xProductVersion = %xProductVersion%

if exist "%xInputToWix%" rmdir  /Q /S  "%xInputToWix%"
set xRelease=%xSolutionDir%Source\Iit.ITBI.MDSManagerService\Bin\%xConfigurationName%\

xcopy /Y /S  "%xRelease%*.*"   "%xInputToWix%Harvest\*.*"

md "%xInputToWix%Config\EnvironmentDependingFiles\Dev"
copy /Y   "%xRelease%..\..\DevConfig\DevApp.config"   "%xInputToWix%Config\EnvironmentDependingFiles\Dev\Iit.ITBI.MDSManagerService.exe.config"

md "%xInputToWix%Config\EnvironmentDependingFiles\Live"
copy /Y   "%xRelease%..\..\LiveConfig\LiveApp.config"   "%xInputToWix%Config\EnvironmentDependingFiles\Live\Iit.ITBI.MDSManagerService.exe.config"

md "%xInputToWix%Config\EnvironmentDependingFiles\Tst"
copy /Y   "%xRelease%..\..\TstConfig\TstApp.config"   "%xInputToWix%Config\EnvironmentDependingFiles\Tst\Iit.ITBI.MDSManagerService.exe.config"

echo move  /Y "%xInputToWix%Harvest\Iit.ITBI.MDSManagerService.exe"   "%xInputToWix%Config\"
move  /Y "%xInputToWix%Harvest\Iit.ITBI.MDSManagerService.exe"   "%xInputToWix%Config\"
echo del  "%xRelease%Harvest\*.config"
del  "%xInputToWix%Harvest\Iit.ITBI.MDSManagerService*.config"



echo --------------------------------------------------------------preBuildEvent.cmd end
